import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// import 'element-plus/dist/index.css'
import 'normalize.css'
import '@/styles/index.scss'

import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import Directives from './directives'

import svgIcon from './icons/Index.vue'

// permission control
// 无登录校验
// import './permission'

// permission control
// 对接了用户中心
import './permissionToken'

// permission control
// 对接了用户中心的跳转登录
// import './permissionTokenLink'

const app = createApp(App)
app.use(ElementPlus, { locale: zhCn })

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

const pinia = createPinia()

app.component('SvgIcon', svgIcon).use(Directives).use(router).use(pinia)
.mount('#app')
